Scroll to navigation

PAPI_assign_eventset_component(3) PAPI PAPI_assign_eventset_component(3)

NAME

PAPI_assign_eventset_component - assign a component index to an existing but empty EventSet

SYNOPSIS

C Interface

#include <papi.h>
PAPI_assign_eventset_component (int EventSet",intcidx);"

DESCRIPTION

PAPI_assign_eventset_component() assigns a specific component index, as specified by cidx, to a new EventSet identified by EventSet, as obtained from PAPI_create_eventset(3). EventSets are ordinarily automatically bound to components when the first event is added. This routine is useful to explicitly bind an EventSet to a component before setting component related options.

ARGUMENTS

EventSet -- An integer identifier for an existing EventSet

cidx -- An integer identifier for a component. By convention, component 0 is always the cpu component.

RETURN VALUES


On success, this function returns PAPI_OK.
On error, a non-zero error code is returned.

ERRORS

The argument cidx is not a valid component.
The EventSet doesn't exist.
Insufficient memory to complete the operation.

EXAMPLES


int EventSet = PAPI_NULL;
if (PAPI_create_eventset(&EventSet) != PAPI_OK)
handle_error(1);
/* Bind our EventSet to the cpu component */
if (PAPI_assign_eventset_component(EventSet, 0) != PAPI_OK)
handle_error(1);
/* Convert our EventSet to multiplexing */
if (PAPI_set_multiplex(EventSet) != PAPI_OK)
handle_error(1);

BUGS

This function has no known bugs.

SEE ALSO

PAPI_create_eventset(3), PAPI_add_event(3), PAPI_set_multiplex(3), PAPI_set_opt(3)

April, 2007 PAPI Programmer's Reference